<script setup>
import {userInfoStore} from '@/stores/user'

const userInfo = userInfoStore()
</script>

<template>
    <div class="publish-head">
        <div class="logo" @click="$router.push('/')">
            <div class="logo-text">
                小红书
            </div>
            <div class="logo-title">
                创作服务平台
            </div>
        </div>
        <div class="user">
            <div class="user-head" v-if="userInfo.userInfo.headImage == '/'">
            </div>
            <img class="head-image" :src="'../../../../../public/headImage/'+userInfo.userInfo.headImage" 
                            v-if="userInfo.userInfo.headImage != '/'"/>
            <div class="user-nickname">
                {{ userInfo.userInfo.nickname }}
            </div>
        </div>
    </div>
</template>

<style scoped lang="scss">
.publish-head{
    background: #ffffff;
    display: flex;
    min-width: 100vw;
    justify-content: space-between;
    .logo{
        display: flex;
        align-items: center;
        padding-top: 20px;
        padding-left: 30px;
        padding-bottom: 20px;
        cursor: pointer;
        .logo-text{
            background: #ff2442;
            padding-top: 5px;
            padding-bottom: 5px;
            padding-left: 10px;
            padding-right: 10px;
            color: white;
            font-weight: bolder;
            border-radius: 15px;
        }
        .logo-title{
            font-size: 20px;
            padding-left: 15px;
        }
    }
    .user{
        display: flex;
        align-items: center;
        padding-right: 50px;
        .user-head{
            min-width: 40px;
            min-height: 40px;
            border-radius: 20px;
            background: #7c7c7c;
        }
        .head-image{
            width: 40px;
            height: 40px;
            border-radius: 20px;
        }
        .user-nickname{
            padding-left: 10px;
        }
    }
    
}
</style>